package com.woniu.smallmedical.server.serverimpl;

import com.github.pagehelper.PageHelper;
import com.woniu.smallmedical.entity.VregAndPat;
import com.woniu.smallmedical.mapper.VregAndPatMapper;
import com.woniu.smallmedical.server.VregAndPatServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author author
 * @create 2021-09-26-8:59
 */
@Service
public class VregAndPatServerServerImpl implements VregAndPatServer {
    @Autowired
    VregAndPatMapper vregAndPatMapper;

    @Override
    public List<VregAndPat> vregAndPats(VregAndPat vregAndPat,int pageIndex, int pageSize) {
        //使用分页插件,核心代码就这一行
        PageHelper.startPage(pageIndex, pageSize);
        List<VregAndPat> vregAndPats = vregAndPatMapper.vregAndPats(vregAndPat);
        return vregAndPats;
    }

    @Override
    public VregAndPat getVregAndPatByPaid(int paid) {
        VregAndPat vregAndPatByPaid = vregAndPatMapper.getVregAndPatByPaid(paid);
        return vregAndPatByPaid;
    }
}
